package top.yangyitao.dto;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import top.yangyitao.entity.Permission;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class PermissionDto{
	long id;//主键

	String name;//名称

	String permission;//权限---映射

	boolean isParent;//是否含有子权限

	Long pid;//父权限主键
	
	String icon;
	
	public PermissionDto convert(Permission permission) {
		setId(permission.getId());
		setName(permission.getName());
		setParent(permission.isParent());
		setPid(permission.getPid());
		setPermission(permission.getStringPermission());
		setIcon(permission.getIcon());
		return this;
	}
}
